﻿@using WebApp.Models
@model RegisterViewModel
@{
    ViewBag.Title = "Register as a new user";
    Layout = "~/Views/Shared/_Layout_CenterBox.cshtml";
}

@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { role = "form" }))
{
    @Html.AntiForgeryToken()

    if (!Html.ViewData.ModelState.IsValid)
    {
        <div class="callout callout-danger">
            <h4>Error</h4>
            <p>@Html.ValidationSummary("")</p>
        </div>
    }

    <div class="form-group has-feedback">
        @Html.TextBoxFor(m => m.Email, new { @class = "form-control", @placeholder = "Email" })
        <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
        <div class="custom-validation-msg text-center">@Html.ValidationMessageFor(m => m.Email)</div>
    </div>

    <div class="form-group has-feedback">
        @Html.PasswordFor(m => m.Password, new { @class = "form-control", @placeholder = "Password" })
        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
        <div class="custom-validation-msg text-center">@Html.ValidationMessageFor(m => m.Password)</div>
    </div>

    <div class="form-group has-feedback">
        @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control", @placeholder = "Confirm password" })
        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
        <div class="custom-validation-msg text-center">@Html.ValidationMessageFor(m => m.ConfirmPassword)</div>
    </div>

    <div class="row">
        <div class="col-xs-8">
        </div>
        <div class="col-xs-4">
            <input type="submit" value="Register" class="btn btn-primary btn-block btn-flat" />
        </div>
    </div>

    <br />
    @*<div class="text-center"><p>- OR -</p></div>
    <div class="to-mid text-center">
        <i class="fa fa-user"></i>&nbsp;
        <a href="@Url.Action("Login")" class="text-center">I already have an account</a>
    </div>*@
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}